var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
    entry: {
        app : ['babel-polyfill', './app/main.js'] //唯一入口文件
    },
    output: {
        path: __dirname + '/',
        publicPath: "../",
        filename: "[name]/bundle.js",
        chunkFilename: "[name]/[id].chunk.js"
    },
    module: {
        loaders: [
            { test: /\.css$/, loader: ExtractTextPlugin.extract({ fallback:'style-loader',use:'css-loader'})},
            { test: /\.(js|jsx)$/, exclude: /node_modules/, loader: 'babel-loader' },
            { test: /\.(gif|jpg|png|svg|woff|eot|ttf|otf)\??.*$/, loader: "url-loader?limit=8192&name=resource/fonts/[name].[ext]"}
        ]
    },
    plugins:  [
        new ExtractTextPlugin({ filename: './[name]/bundle.css', disable: false, allChunks: true })
    ]
};